﻿Public Class LoginForm
    Dim dims As New dims
    Private Sub LoginForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Launcher.Opacity = 0
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Launcher.Close()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If System.IO.File.Exists(dims.ProfileDir + dims.privConf + "\" + TextBox1.Text + "\" + "username.MVBOS") = False Then
            MessageBox.Show("This user doesn't exist! Do you want to create it?")
        Else
            If System.IO.File.Exists(dims.ProfileDir + dims.privConf + "\" + TextBox1.Text + "\" + "pass.MVBOS") = False Then
                MessageBox.Show("This user has got messed up configuration. We will make fix to this thing later! ERROR: MISSING password.MVBOS")
            Else
                Dim passFile As String = dims.ProfileDir + dims.privConf + "\" + TextBox1.Text + "\" + "pass.MVBOS"
                Dim passRead As New IO.StreamReader(passFile)
                Debug1.passLoad.Text = passRead.ReadToEnd
                passRead.Close()
                If Debug1.passLoad.Text = TextBox2.Text Then
                    BootAnimation.ShowDialog()
                Else
                    MessageBox.Show("Incorrect password! Didn't you make a typo?")
                End If
            End If
        End If
    End Sub
End Class